import {NgModule, ModuleWithProviders, InjectionToken} from '@angular/core';
import {RouterModule} from '@angular/router';
import {SeoConfig} from "@core/seo/seo-config.modal";
import {SeoService} from "@core/seo/seo.service";

export const SEO_CONFIG = new InjectionToken('seoConfig');

@NgModule({
  imports: [RouterModule]
})
export class SeoModule {
  static forRoot(seoConfig: SeoConfig = {useTitleSuffix: true, defaults: {}}): ModuleWithProviders {
    return {
      ngModule: SeoModule,
      providers: [
        {provide: SEO_CONFIG, useValue: seoConfig},
        SeoService
      ]
    };
  }
}
